﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Xml;
using System.IO;
using System.Web;

namespace AliCMS.AdModule
{
    public interface IInstanceConfig : IObject
    {
        Dictionary<string, string> GetBasicSettings();
        void SetBasicSettings(Dictionary<string, string> value);

        void Rebuild();
        void GenerateCacheFile();
    }
    public interface ISubInstance : IDbObject
    {
    }
    public interface IType : IObject
    {
        int GetInnerIDFromGuid(Guid guid);
        Guid GetGuidFromInnerID(object id);
        Dictionary<string, object> Get(object id);
        Guid Add(Dictionary<string, object> item);
        void Modify(int id, Dictionary<string, object> changes);
        void Delete(int id);
        DataTable List(int page, int pageSize, Dictionary<string, object> condition, Dictionary<string, string> sort);
        DataTable List(int page, int pageSize, string condition, string sort);
        int GetRecordCount(Dictionary<string, object> condition);
        int GetRecordCount(string condition);

        void UploadTemplate(string fieldName, ref string uploadFile, bool isLast);
    }
    public interface IPosition : IDbObject
    {
        void Recycle(int id);
        void Recover(int id);

        void UploadSketchMap(string fieldName, ref string uploadFile, bool isLast);

        void UploadImage(string fieldName, ref string uploadFile, bool isLast);

        string GenerateCacheFile(int id);
        string BuildInvoke(int id, string con);
    }
    public interface IAd : IDbObject
    {
        void Recycle(int id);
        void Recover(int id);
        void Check(int id);
        void Move(int from, int to);

        DataTable ListCpt(int page, int pageSize, string condition, string sort);
        int GetCptRecordCount(string condition);

        void UploadImage(string fieldName, ref string uploadFile, bool isLast);

        void SettleCpc(int id);
        void SettleCpt(int id, DateTime startTime, DateTime endTime);
    }
    public interface IClick : IDbObject
    {
        DataTable ListCpc(int page, int pageSize, string condition, string sort);
        int GetCpcRecordCount(string condition);

        void ClickAd(int adID);
    }
    public interface IIncome : IDbObject
    {
    }
    namespace Type
    {
        public interface IResource : IObject
        {
            DataTable ListFile(int typeID, string folderName);
            void DeleteFile(int typeID, string folderName, string fileName);

            DataTable ListFolder(int typeID);
            void DeleteFolder(int typeID, string folderName);
            void AddFolder(int typeID, string folderName);

            void Upload(string fieldName, ref string uploadFile, bool isLast);
        }
    }
}
